/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: wangxin
 * Date: 2024-08-26
 * Time: 16:51
 */
public class Dog{
    public String name;

    public String color;
    // 狗的属性
    public void barks() {
        System.out.println(this.name + ": 旺旺旺~~~");
    }
    // 狗的行为
    public void wag() {
        System.out.println(this.name + ": 摇尾巴~~~");
    }

    public static void main(String[] args) {

            Dog dogh = new Dog(); //通过new实例化对象
            dogh.name = "阿黄";
            dogh.color = "黑黄";
            dogh.barks();
            dogh.wag();
            Dog dogs = new Dog();
            dogs.name = "阿黑";
            dogs.color = "黑白";
            dogs.barks();
            dogs.wag();
        }

}
